package com.service.impl;

import com.bean.CdyOrder;
import com.dao.CdyOrderMapper;
import com.service.CdyOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Component
@Service
public class CdyOrderServiceImpl implements CdyOrderService {

    @Autowired
    private CdyOrderMapper cdyOrderMapper;

    @Override
    public int save(CdyOrder cdyOrder) {
        return cdyOrderMapper.insert(cdyOrder);
    }

    @Override
    public int remove(CdyOrder cdyOrder) {
        return cdyOrderMapper.delete(cdyOrder);
    }

    @Override
    public int modify(CdyOrder cdyOrder) {
        return cdyOrderMapper.update(cdyOrder);
    }

    @Override
    public List<CdyOrder> find(CdyOrder cdyOrder) {
        return cdyOrderMapper.select(cdyOrder);
    }

    @Override
    public int count(Map<String, Object> map) {
        return cdyOrderMapper.selectCount(map);
    }

    @Override
    public List<CdyOrder> query(Map<String, Object> map) {
        return cdyOrderMapper.selectByPage(map);
    }
}
